
package pl.genapp.stocksense.others;

import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;

import android.graphics.Color;
import android.graphics.Paint.Align;

public class TimeChartHelper {
	
	public static XYMultipleSeriesRenderer initializeRendered(String name) {
		
		XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
		mRenderer.setAxisTitleTextSize(16);
		mRenderer.setChartTitleTextSize(20);
		mRenderer.setLabelsTextSize(15);
		mRenderer.setLegendTextSize(15);
		mRenderer.setPointSize(3f);
		mRenderer.setAntialiasing(true);
		mRenderer.setGridColor(0x40E1E3E8);
		mRenderer.setShowGrid(true);
		mRenderer.setYLabelsAlign(Align.RIGHT);
		mRenderer.setShowLegend(false);
		mRenderer.setMargins(new int[] { 30, 40, 10, 10 });
		mRenderer.setApplyBackgroundColor(true);
		mRenderer.setBackgroundColor(Color.TRANSPARENT);
		mRenderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
		mRenderer.setLabelsColor(Color.BLACK);
		mRenderer.setYLabelsColor(0, Color.BLACK);
		mRenderer.setXLabelsColor(Color.BLACK);
		mRenderer.setChartTitle(name);
		mRenderer.setPanEnabled(false, false);
		mRenderer.setZoomEnabled(false, false);
		return mRenderer;
		
	}
	
	public static XYSeriesRenderer initializeFinanceLine() {
		
		XYSeriesRenderer r = new XYSeriesRenderer();
		r.setColor(0xFF344BC9);
		r.setFillPoints(true);
		r.setFillBelowLine(true);
		r.setFillBelowLineColor(0x70A0ABEB);
		
		return r;
		
	}
	
	
	public static XYSeriesRenderer initializeSentLine(int color) {
		
		XYSeriesRenderer r = new XYSeriesRenderer();
		r.setColor(color);
		r.setFillPoints(true);
		
		return r;
		
	}
}
